<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <title>添加</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/hn-jg/layui/css/layui.css">
	<link rel="stylesheet" href="/hn-jg/src/css/public.css">
</head>

<body>
    <div style="padding: 10px;">
        <form class="layui-form" action="" lay-filter="addForm">
            <ul class="layui-form layui-form-pane formUl" style="margin: 15px;">
				<li class="layui-form-item">
					<label class="layui-form-label">用户名</label>
					<div class="layui-input-block">
						<input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆IP</label>
					<div class="layui-input-block">
						<input type="text" name="loginip" lay-verify="required" autocomplete="off" placeholder="请输入登陆IP" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登录地址</label>
					<div class="layui-input-block">
						<input type="text" name="loginaddres" lay-verify="required" autocomplete="off" placeholder="请输入登录地址" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆结果</label>
					<div class="layui-input-block">
						<input type="text" name="loginresult" lay-verify="required" autocomplete="off" placeholder="请输入登陆结果" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆状态</label>
					<div class="layui-input-block">
						<input type="text" name="loginstate" lay-verify="required" autocomplete="off" placeholder="请输入登陆状态" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆浏览器</label>
					<div class="layui-input-block">
						<input type="text" name="loginbrow" lay-verify="required" autocomplete="off" placeholder="请输入登陆浏览器" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆操作系统</label>
					<div class="layui-input-block">
						<input type="text" name="loginwindow" lay-verify="required" autocomplete="off" placeholder="请输入登陆操作系统" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">登陆时间</label>
					<div class="layui-input-block">
						<input type="text" name="logintime" lay-verify="required" autocomplete="off" placeholder="请输入登陆时间" class="layui-input">
					</div>
				</li>
				<li class="layui-form-item">
					<label class="layui-form-label">备注</label>
					<div class="layui-input-block">
						<input type="text" name="remark" lay-verify="required" autocomplete="off" placeholder="请输入备注" class="layui-input">
					</div>
				</li>
			</ul>

            <div style="text-align: center;">
				<button type="button" class="layui-btn" lay-submit id="YjbtnSave" lay-filter="YjbtnSave">添加</button>
			</div>
        </form>
    </div>
    <script src="/hn-jg/layui/layui.js"></script>
    <script>
        layui.use(function () {
			var form = layui.form
				, admin = parent.layui.admin
				, table = parent.layui.table;

			//添加
			form.render().on('submit(YjbtnSave)', function (data) {
				admin.req({
					url: 'system/loginlog/Add'
					, data: JSON.stringify(data.field)
					, contentType: 'application/json'
					, type: 'post'
					, done: function (res) {
						if (res.successful) {
							admin.msg_success(res.msg);
							table.reload('LAY-app-loginlog-list');
						}
						else {
							admin.msg_error(res.msg);
						}
					}
				});
			})
		});
    </script>
</body>
</html>